package com.sky.controller.common;

import com.sky.entity.Register;
import com.sky.result.Result;
import com.sky.service.RegisterService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@CrossOrigin
@RequestMapping("/register")
@Api(tags = "注册相关接口")
public class RegisterController {
    @Autowired
    private RegisterService registerService;
    @PostMapping
    public Result<String> register(@RequestBody Register register){
        String username = registerService.register(register);
        return Result.success(username);
    }
}
